package com.cuit.zuke.admin.mapper;

import com.cuit.zuke.admin.pojo.Admin;
import com.cuit.zuke.admin.pojo.Department;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface AdminMapper {
    /*查询所有管理员*/
    List<Admin> queryAllAdmin(int currentPage, int pageSize);
    /*查询管理员的数量*/
    int adminTotal();
    /*查询每个管理员对应的role*/
    List<Long> queryAllRole(Long userId);
    /*查询每个管理员对应的部门*/
    String queryDepartName(Long departmentId);
    /*根据id查询管理员*/
    Admin queryUserById(Long userId);
    /*查询所有部门*/
    List<Department> queryAllDepart();
    /*根据parent_id查询父部门*/
    Department queryFatherDepartByParentID(Long parentId);
    /*根据parent_id查询子部门*/
    List<Department> queryChildDepartByParentID(Long id);
    /*根据ChildDepartmentId获得管理员列表*/
    List<Admin> queryAdminByChildDepartmentId(Long departmentId, int currentPage, int pageSize);
    /*根据FatherDepartmentId获得管理员列表*/
    List<Admin> queryAdminByFatherDepartmentId(Long departmentId, int currentPage, int pageSize);
    /*根据ChildDepartmentId获得部门下的人数*/
    int queryAdminTotalByChildDepartmentId(Long departmentId);
    /*根据FatherDepartmentId获得部门下的人数*/
    int queryAdminTotalByFatherDepartmentId(Long departmentId);
    /*根据userid删除管理员*/
    void deleteAdmin(Long userId);
}
